<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String basepath=request.getScheme()+"://"+
            request.getServerName()+":"+request.getServerPort()+
            request.getContextPath()+"/";
%>
<html>
<head>
    <base href="<%=basepath%>">
    <title>Title</title>
    <script src="jquery/jquery-3.4.1.js"></script>
    <script SRC="ECharts/echarts.min.js"></script>
    <script>
        $(function (){
            getCharts();
        })
        function getCharts(){
            $.ajax({
                url:"workbench/transaction/getcharts.do",
                data:{

                },
                type:"get",
                dataType:"json",
                success:function (data){
                    var mychart=echarts.init(document.getElementById('main'))
                    var option = {
                        tooltip: {
                            trigger: 'item',
                            formatter: '{a} <br/>{b}: {c} ({d}%)'
                        },
                        legend: {
                            orient: 'vertical',
                            left: 10,
                            data: data.la2
                        },
                        series: [
                            {
                                name: '交易阶段',
                                type: 'pie',
                                radius: ['50%', '70%'],
                                avoidLabelOverlap: false,
                                label: {
                                    show: false,
                                    position: 'center'
                                },
                                emphasis: {
                                    label: {
                                        show: true,
                                        fontSize: '30',
                                        fontWeight: 'bold'
                                    }
                                },
                                labelLine: {
                                    show: false
                                },
                                data: data.la1
                            }
                        ]
                    };
                    // 使用刚指定的配置项和数据显示图表。
                    mychart.setOption(option);
                }
            })


        }
    </script>
</head>
<body>
<div id="main" style="width: 80%;height: 80%"></div>
</body>
</html>
